﻿
    using System;
    using System.Runtime.CompilerServices;
namespace WCYCReader.ImageTool
{
    public sealed class ImageProperty : IEquatable<ImageProperty>
    {
        private string _name;

        public ImageProperty(string name, string value)
        {
            Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(name), "Name cannot be null or empty.");
            this._name = name;
            this.Value = value;
        }

        public bool Equals(ImageProperty other)
        {
            if (other == null)
            {
                return false;
            }
            return (object.Equals(this.Name, other.Name) && object.Equals(this.Value, other.Value));
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }
            return this.Equals(obj as ImageProperty);
        }

        public override int GetHashCode()
        {
            int num = 1;
            if (this.Name != null)
            {
                num ^= this.Name.GetHashCode();
            }
            if (this.Value != null)
            {
                num ^= this.Value.GetHashCode();
            }
            return num;
        }

        public string Name
        {
            get
            {
                Contract.Ensures(!string.IsNullOrEmpty(Contract.Result<string>()));
                return this._name;
            }
        }

        public string Value { get; set; }
    }
}

